/*** Eclipse Class Decompiler plugin, copyright (c) 2012 Chao Chen (cnfree2000@hotmail.com) ***/
package com.feiyue.helper;

import android.content.Context;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.SimpleAdapter;
import android.widget.TextView;
import com.feiyue.basic.server.parser.Chapter;
import java.util.List;
import java.util.Map;

public class BookCatologAdapter extends SimpleAdapter {
	private List<Chapter> chapterlist;
	private int currentPosition;
	private LayoutInflater inflater;
	private int resource;

	public BookCatologAdapter(Context paramContext,
			List<? extends Map<String, ?>> paramList, int paramInt1,
			String[] paramArrayOfString, int[] paramArrayOfInt,
			List<Chapter> paramList1, int paramInt2) {
		super(paramContext, paramList, paramInt1, paramArrayOfString,
				paramArrayOfInt);
		this.inflater = ((LayoutInflater) paramContext
				.getSystemService("layout_inflater"));
		this.resource = paramInt1;
		this.chapterlist = paramList1;
		this.currentPosition = paramInt2;
	}

	public View getView(int paramInt, View paramView, ViewGroup paramViewGroup) {
		if (paramView == null)
			paramView = this.inflater.inflate(this.resource, paramViewGroup,
					false);
		if (paramInt == this.currentPosition) {
			TextView localTextView3 = (TextView) paramView
					.findViewById(2131099795);
			localTextView3.setTextColor(-7640003);
			localTextView3.setText(paramInt + 1);
			TextView localTextView4 = (TextView) paramView
					.findViewById(2131099796);
			localTextView4.setText(((Chapter) this.chapterlist.get(paramInt))
					.getName());
			localTextView4.setTextColor(-7640003);
			return paramView;
		}
		TextView localTextView1 = (TextView) paramView.findViewById(2131099795);
		localTextView1.setTextColor(-9935525);
		localTextView1.setText(paramInt + 1);
		TextView localTextView2 = (TextView) paramView.findViewById(2131099796);
		localTextView2.setText(((Chapter) this.chapterlist.get(paramInt))
				.getName());
		localTextView2.setTextColor(-9935525);
		return paramView;
	}

	public void setCurrentPosition(int paramInt) {
		this.currentPosition = paramInt;
	}
}